This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I am not 100% sure where you are getting the mail file paths from, e.g. if you are already cycling across person documents in an Address book (if you are, then obv' get user name from person doc field "FullName"), following assumes you are not.
You could create a view in names.nsf by mail file path, but I am pretty sure you will not be allowed to do that(?), if you can, then getDocumentByKey(mailFilePath). How many names are in the names.nsf? Is it Full Text Indexed (you may be hitting multiple servers)? If FTI, then will be simpler, if not FTI'd then depending on frequency and some other bits I don't know about your application, you will probably have to cycle through person docs in names.nsf, and depending on how big the NAB this, that processing could be way too slow, so maybe poll every x and store results somewhere else.
One thing to be careful of, mail file paths in person doc might be "mail\nwall" or "mail\nwall.nsf"
// If names.nsf is FTI'd, maybe you just search for CONTAINS, would take care of "mail\nwall" or "mail\nwall.nsf"
dc_nab = db_nab.FTSearch("FIELD form=\"Person\" AND FIELD MailFile=\"" + TEST_PATH + "\"", 0);
System.out.println("...dc_nab.count: " + dc_nab.getCount());
if (dc_nab.getCount()==1){
doc_nab = dc_nab.getFirstDocument();
// FullName field is acuually an array of values, but for simplicity sake
s_user_name = doc_nab.getItemValueString("FullName");
System.out.println("...s_user_name=" + s_user_name);
}else{
// You have some sort of duplicate issue
}
//If you don't have FTI, then bit more of a hassle.
doc_nab = vw_nab.getFirstDocument();
while(doc_nab!=null){
doc_next = vw_nab.getNextDocument(doc_nab);
if(doc_nab.getItemValueString("MailFile").equalsIgnoreCase(TEST_PATH)){
// Found match. you may need to continue checking, in case of a dup
}
doc_nab.recycle();
doc_nab = doc_next;
}
Feedback response number WEBB9A6DGV created by ~Holly Quetfookony on 08/01/2013